﻿/********************************************************************************************************************
* Author:	Aris Mihail																						*
* Email:	std03055@di.uoa.gr																						*
* Purpose:	This script is used in order to create the stored procedure "usp_emailExists" that returns 1 if a 	*
*			given email already exists in the database.															*
********************************************************************************************************************/

CREATE PROCEDURE [dbo].[usp_emailExists]
	@email nvarchar(50)
AS
	IF EXISTS (SELECT * FROM Users WHERE users.Email = @email)
		RETURN 1
	ELSE
		RETURN 0